<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #small{width: 300px;height: 500px;position: absolute;left: 50px;top: 50px;}
        #small img{width: 100%;height: 100%;}
        #mark{width: 100px;height: 100px;background: white;opacity: 0.5;position: absolute;top: 0;left: 0;}
        #big{display: none; width: 400px;height: 400px;border: 1px solid black;left: 500px;top: 50px;position: absolute;overflow: hidden;}
        #big img{width: 1200px;height: 2000px;position: absolute;left: 0;top: 0;}
    </style>
    <script>
        window.onload = function(){
            var oSmall = document.getElementById("small");
            var oBig = document.getElementById("big");
            var oMark = document.getElementById("mark");
            var oBigImage = oBig.getElementsByTagName("img")[0];
            
            oSmall.onmouseover = function(){
                oMark.style.display = "block";
                oBig.style.display = "block";
            }
            oSmall.onmouseout = function(){
                oMark.style.display = "none";
                oBig.style.display = "none";
            }
            oSmall.onmousemove = function(ev){
                var e = ev||window.event;
                var l = e.clientX - oSmall.offsetLeft -50;
                var t = e.clientY - oSmall.offsetTop -50;
                if(l<=0) l = 0;
                if(t<=0) t = 0;
                if(l>=200) l= 200;
                if(t>=400) t = 400;
                oMark.style.left = l + "px";
                oMark.style.top = t + "px";
                oBigImage.style.left = -l*4 + "px";
                oBigImage.style.top = -t*4 + "px";
            }
        }
    </script>
</head>
<body>
    <div id="small">
        <img src="../028 3D效果/img/5.jpg" alt="">
        <div id="mark"></div>
    </div>
    <div id="big">
        <img src="../028 3D效果/img/5.jpg" alt="">
    </div>
</body>
</html>